<?php

App::uses('AppModel', 'Model');

/**
 * Preference Model
 *
 */
class Preference extends AppModel {

    /**
     * Validation rules
     *
     * @var array
     */
    public $validate = array(
        'title' => array(
            'notEmpty' => array(
                'rule' => array('notEmpty'),
            //'message' => 'Your custom message here',
            //'allowEmpty' => false,
            //'required' => false,
            //'last' => false, // Stop validation after this rule
            //'on' => 'create', // Limit validation to 'create' or 'update' operations
            ),
        ),
    );

    public function listOption() {
        $data = $this->Find('list', array(
            'fields' => array('title'),
            'order' => array('title ASC')
        ));

        return $data;
    }
    
    public function listOptionL() {
        $data = $this->Find('all', array(
            'fields' => array('Preference.id,Preference.title'),
            'order' => array('Preference.title ASC')
        ));

        return $data;
    }

}
